package 码云作业;
import java.io.File;

public class taxt05 {
	public static void showFileList(String path){
        File file = new File(path);
        File[] listFile=file.listFiles();
        StringBuffer sb1 = new StringBuffer("文件：");
        StringBuffer sb2 = new StringBuffer("文件夹：");
        for(File list:listFile){
            if(list.isFile()){
                sb1.append("\t").append(list.getName()).append(" ");
            }else if(list.isDirectory()){
                sb2.append("\t").append(list.getName()).append(" ");
            }
        }
        System.out.println(sb1.toString());
        System.out.println(sb2.toString());
    }

    public static void main(String[] args) {
        showFileList("D:\\");
    }
}
